<template>
	<view class="content">
		<view class="swiper">
			<view class="swiper-con">
				<uv-swiper :list="list3" indicator indicatorMode="line" circular height="195" radius="8"></uv-swiper>
			</view>
		</view>

		<view class="tab">
			<uv-tabs :list="list" @click="clickTab" lineColor="#E90D00"
				:activeStyle="{color: '#000',fontSize:'28rpx',fontWeight:'600'}"
				:inactiveStyle="{color: '#828999',fontSize:'28rpx'}">
				<template v-slot:right>
					<view style="padding-left: 4px;" @tap="toast" hover-class="activeM">
						<uv-icon name="list" size="21" bold></uv-icon>
					</view>
				</template>
				</uv-tabs>
		</view>

		<view class="shop-box">
			<Waterfall :list="goodsList" :columnCount="2" :gap="10">
				<template #default="{ item }">
					<view class="shop-box-item" hover-class="activeM" @click="goDetail(item)">
						<view class="img">
							<image :src="item.image" mode="widthFix"></image>
						</view>

						<view class="text1">
							泡泡玛特 X 壹橙视觉 labubu和周边泡泡玛特 X 壹橙视觉 labubu和周边
						</view>
						
						<view class="price">
						<span style="font-weight: 400;font-size: 24rpx;margin-top: 2rpx;">￥</span>3680.00
						</view>

						<view class="text2">
							<view class="text2-l">
								<view class="avatar">
									<image src="/static/images/quequanquanbu.png" mode="widthFix"></image>
								</view>

								<view class="nickname">
									布果chacoco布果chacoco
								</view>

							</view>
							<view class="text2-r">
								<!-- <uv-icon name="heart" color="#828999" size="24"></uv-icon> -->
								<!-- 点击收藏 -->
								<uv-icon name="heart-fill" color="#fa2800" size="18"></uv-icon>
								12
							</view>
						</view>
					</view>
				</template>
			</Waterfall>
		</view>
		
		<view class="xinjian" hover-class="activeM" @click="createQq">
			<uv-icon name="plus" size="12" color="#fff"></uv-icon>发布作品
		</view>
	</view>
</template>

<script setup>
	import Waterfall from '@/components/Waterfall.vue'
	import {
		ref,
		reactive
	} from 'vue'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import {
		baseUrl,
		http
	} from '@/utils/request'
	import emitter from '@/utils/emitter.js'
	import {
		showMsg
	} from '@/utils/showMsg'

	const list3 = ref([
		'https://picsum.photos/id/1011/600/800', 'https://picsum.photos/id/1012/600/800',
		'https://picsum.photos/id/1013/600/800'
	])

	const list = ref([{
		id: 1,
		name: '设计作品',
	}, {
		id: 2,
		name: 'IP',
	}, {
		id: 3,
		name: '素材'
	}, {
		id: 4,
		name: '文创'
	}, {
		id: 5,
		name: '动漫'
	}, {
		id: 6,
		name: '工业/产品'
	}])

	const clickTab = (item) => {
		console.log(item);
	}

	const goodsList = ref([{
			image: 'https://picsum.photos/id/1011/200/300',
		},
		{
			image: 'https://picsum.photos/id/1012/200/400',
		},
		{
			image: 'https://picsum.photos/id/1013/200/500',
		},
		{
			image: 'https://picsum.photos/id/1014/200/350',
		},
		{
			image: 'https://picsum.photos/id/1015/200/450',
		},
		{
			image: 'https://picsum.photos/id/1016/200/600',
		},
	])
	
	const goDetail = (item) => {
		uni.navigateTo({
			url:'/subpackages/home/designDetail'
		})
	}
	
	const toast = () => {
		uni.navigateTo({
			url:'/subpackages/home/sjFl'
		})
	}
	
	const createQq = () => {
		uni.navigateTo({
			url:'/subpackages/home/postZp'
		})
	}
</script>

<style lang="scss" scoped>
	.swiper {
		width: 100%;
		padding: 0rpx 30rpx;

		.swiper-con {
			width: 100%;
			height: 390rpx;
		}
	}

	.tab {
		width: 100%;
		padding: 0rpx 30rpx;
		margin-top: 30rpx;
	}

	.shop-box {
		width: 100%;
		margin-top: 30rpx;
		padding: 0rpx 30rpx;

		.shop-box-item {
			box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
			padding-bottom: 10rpx;
			border-radius: 0rpx 0rpx 8rpx 8rpx;

			.img {
				position: relative;
				width: 100%;

				image {
					width: 100% !important;
					// height: 400rpx !important;
					border-radius: 8rpx 8rpx 8rpx 8rpx !important;
				}
			}


			.text1 {
				width: 100%;
				margin: 20rpx 0rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
				font-weight: 600;
				font-size: 30rpx;
				color: #000000;
				padding: 0rpx 10rpx;
			}
			
			.price{
				width: 100%;
				margin-bottom: 20rpx;
				font-weight: 600;
				font-size: 32rpx;
				color: #E90D00;
				padding: 0rpx 10rpx;
			}

			.text2 {
				width: 100%;
				display: flex;
				padding: 0rpx 10rpx;

				.text2-l {
					width: 60%;
					display: flex;
					align-items: center;
					gap: 10rpx;

					.avatar {
						width: 36rpx;
						height: 36rpx;

						image {
							width: 36rpx !important;
							height: 36rpx !important;
							border-radius: 50% !important;
						}
					}

					.nickname {
						width: calc(100% - 36rpx);
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
						font-weight: 400;
						font-size: 24rpx;
						color: #9095A8;
					}
				}

				.text2-r {
					width: 40%;
					display: flex;
					align-items: center;
					justify-content: flex-end;
					gap: 10rpx;
					font-weight: 400;
					font-size: 24rpx;
					color: #9095A8;
				}
			}
		}
	}
	
	.xinjian {
		position: fixed;
		bottom: 30rpx;
		left: 50%;
		transform: translateX(-50%);
		width: 205rpx;
		height: 76rpx;
		background: #E90D00;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(233, 13, 0, 0.5);
		border-radius: 38rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10rpx;
		font-weight: 400;
		font-size: 30rpx;
		color: #FFFFFF;
	}
</style>